package controllers

import (
	"echoDev/frans"
	"github.com/labstack/echo"
	"net/http"
)

type UserController struct {
	*frans.GormAdapter
	BaseController
}

func NewUserController() *UserController {
	return &UserController{}
}

func (this *UserController) Index(ctx echo.Context) error {
	return ctx.JSON(http.StatusOK, echo.Map{"code": "OK"})
}

func (this *UserController) UserList(ctx echo.Context) error {
	return ctx.JSON(http.StatusOK, echo.Map{"code": "OK", "users": "userList"})
}

func (this *UserController) Route(r *echo.Group) {
	r.GET("/user", this.Index)
	r.GET("/userlist", this.UserList)
}
